package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.vo.BaseStatisticsVO;
import com.cskaoyan.service.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/stat")
public class AdminStatController {

    @Autowired
    AdminStatService adminStatService;

    /**
     * 用户统计
     * @return
     */
    @GetMapping("user")
    public BaseRespVo queryStatUser() {
        BaseStatisticsVO baseStatisticsVO = adminStatService.queryStatUser();
        return BaseRespVo.ok(baseStatisticsVO);
    }

    /**
     * 订单统计
     * @return
     */
    @GetMapping("order")
    public BaseRespVo queryStatOrder() {
        BaseStatisticsVO baseStatisticsVO = adminStatService.queryStatOrder();
        return BaseRespVo.ok(baseStatisticsVO);
    }

    /**
     * 商品统计
     * @return
     */
    @GetMapping("goods")
    public BaseRespVo queryStatGoods() {
        BaseStatisticsVO baseStatisticsVO = adminStatService.queryStatGoods();
        return BaseRespVo.ok(baseStatisticsVO);
    }

}
